<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class CategoryRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'cate_name'   => 'required|min:2',
            'cate_sort'   => 'required|numeric'
        ];
    }

    //。。
//    public function messages()
//    {
//        return  [
//            'cate_name.integer' => '排序必须是数值',
//            'cate_name.required'=> '分类名必须填写',
//            'cate_name.min'     => '分类名字最小长度是2'
//        ];
//    }
}
